Kerry Back
For a neuron with
\[ y = \max(0, b + w_1x_1 + \cdots + w_n x_n)\]
There are many ways to take care of outliers and scaling, but we’ll just use one.
Distribution before (old) and after (new)
0.06097467915277932
from sqlalchemy import create_engine
import pymssql
import pandas as pd
server = "mssql-82792-0.cloudclusters.net:16272"
username = "user"
password = "" # paste password between quote marks
database = "ghz"
string = "mssql+pymssql://" + username + ":" + password + "@" + server + "/" + database
conn = create_engine(string).connect()from sklearn.preprocessing import QuantileTransformer
from sklearn.neural_network import MLPRegressor
from sklearn.pipeline import make_pipeline
transform = QuantileTransformer(
output_distribution="normal"
)
model = MLPRegressor(
hidden_layer_sizes=(4, 2),
random_state=0
)
pipe = make_pipeline(transform, model)
Workflow is same for random forest, except that we can just fit the model and skip the pipeline.